package com.code.demo.ui.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.code.demo.R;
import com.code.demo.eventbus.EventBase;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Created by android on 2018/11/30.
 */

public class BaseActivity extends AppCompatActivity {

    public boolean isExist = false;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base);

        EventBus.getDefault().register(this);

        isExist = true;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);

        isExist = false;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onEvent(EventBase event) {
    }

}
